package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Purmb;
import com.clouds.wms.dao.PurmaDao;
import com.clouds.wms.dao.PurmbDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("purmbService")
public class PurmbServiceImpl implements PurmbService {
	@Resource(name="purmbDao")
	private PurmbDao purmbDao;
	@Resource(name="purmaDao")
	private PurmaDao purmaDao;

	@Override
	public PagesBean getPurmbList(String maaa, String maab, int offset,	int pageSize) throws SysException {
		return purmbDao.getPurmbList(maaa, maab, offset, pageSize);
	}

	@Override
	public int savePurcb(Purmb purmb) throws SysException {
		return purmbDao.savePurcb(purmb);
	}

	@Override
	public int getMaxMbac() throws SysException {
		return purmbDao.getMaxMbac();
	}

	@Override
	public int delPurmb(String mbaa, String mbab, String mbacs)	throws SysException {
		return purmbDao.delPurmb(mbaa, mbab, mbacs);
	}

	@Override
	public int updatePurcb(Purmb purmb) throws SysException {
		return purmbDao.updatePurcb(purmb);
	}

	@Override
	public int changeStatus(String mbaa, String mbab, String status)throws SysException {
		return purmbDao.changeStatus(mbaa, mbab, status);
	}

	@Override
	public void delPurmamb(String maaa, String maab) throws SysException {
		purmaDao.delPurmaByAaAb(maaa, maab);
		purmbDao.delPurmbByAaAb(maaa, maab);
	}

	@Override
	public void delPurmbAll(String maaa, String maab) throws SysException {
		purmbDao.delPurmbByAaAb(maaa, maab);
	}
}
